<?php

namespace app\admin\model;

use app\crm\controller\Contract;
use think\Db;
use app\admin\model\Common;
use think\Request;
use think\Validate;

class Matter extends Common
{
	/**
     * 为了数据库的整洁，同时又不影响Model和Controller的名称
     * 我们约定每个模块的数据表都加上相同的前缀，比如CRM模块用crm作为数据表前缀
     */
	protected $name = 'admin_matter';
    protected $createTime = 'created_time';
	protected $autoWriteTimestamp = true;

	/**
     * [getDataList 办件事项]
     */		
	public function getDataList($request)
    {
        $list = db('admin_matter')->limit(($request['page']-1)*$request['limit'], $request['limit'])->select();
        $dataCount= db('admin_matter')->count();
        $data = [];
        $data['list'] = $list ? : [];
        $data['dataCount'] = $dataCount ? : 0;
        return $data;
    }

}